//
//  UIView+HTExtention.m
//  Tools
//
//  Created by han on 2019/1/16.
//  Copyright © 2019 han. All rights reserved.
//

#import "UIView+HTExtention.h"

@implementation UIView (HTExtention)

- (void)setHt_x:(CGFloat)ht_x{
    CGRect frame = self.frame;
    frame.origin.x = ht_x;
    self.frame = frame;
}
- (CGFloat)ht_x{
    return self.frame.origin.x;
}
- (void)setHt_y:(CGFloat)ht_y{
    CGRect frame = self.frame;
    frame.origin.y = ht_y;
    self.frame = frame;
}
- (CGFloat)ht_y
{
    return self.frame.origin.y;
}
- (void)setHt_centerX:(CGFloat)ht_centerX{
    CGPoint center = self.center;
    center.x = ht_centerX;
    self.center = center;
}
- (CGFloat)ht_centerX{
    return self.center.x;
}
- (void)setHt_centerY:(CGFloat)ht_centerY{
    CGPoint center = self.center;
    center.y = ht_centerY;
    self.center = center;
}

- (CGFloat)ht_centerY{
    return self.center.y;
}

- (void)setHt_width:(CGFloat)ht_width{
    CGRect frame = self.frame;
    frame.size.width = ht_width;
    self.frame = frame;
}
- (CGFloat)ht_width{
    return self.frame.size.width;
}

- (void)setHt_height:(CGFloat)ht_height{
    CGRect frame = self.frame;
    frame.size.height = ht_height;
    self.frame = frame;
}
- (CGFloat)ht_height{
    return self.frame.size.height;
}

- (void)setHt_size:(CGSize)ht_size{
    CGRect frame = self.frame;
    frame.size = ht_size;
    self.frame = frame;
}

- (CGSize)ht_size{
    
    return self.frame.size;
}

- (void)setHt_origin:(CGPoint)ht_origin{
    CGRect frame = self.frame;
    frame.origin = ht_origin;
    self.frame = frame;
}
- (CGPoint)ht_origin{
    return self.frame.origin;
}
- (void)setHt_top:(CGFloat)ht_top{
    self.frame = CGRectMake(self.ht_left, ht_top, self.ht_width, self.ht_height);
}
- (CGFloat)ht_top{
    return self.frame.origin.y;
}
- (void)setHt_bottom:(CGFloat)ht_bottom{
    self.frame = CGRectMake(self.ht_left, ht_bottom - self.ht_height, self.ht_width, self.ht_height);
}
- (CGFloat)ht_bottom{
    return self.frame.origin.y + self.frame.size.height;
}

- (void)setHt_left:(CGFloat)ht_left{
    self.frame = CGRectMake(ht_left, self.ht_top, self.ht_width, self.ht_height);
}
- (CGFloat)ht_left{
    return self.frame.origin.x;
}

- (void)setHt_right:(CGFloat)ht_right{
    self.frame = CGRectMake( ht_right - self.ht_width, self.ht_top, self.ht_width, self.ht_height);
}

- (CGFloat)ht_right{
    return self.frame.origin.x + self.frame.size.width;
}

@end
